package com.example.project.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.example.project.annotation.FieldMeta;
import com.example.project.core.domain.BaseEntity;

/**
 * 附件，存储系统中所有上传的文件信息对象 t_attachments
 * 
 * @author ruoyi
 * @date 2025-09-23
 */
public class Attachment extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/** 附件ID，主键 */
	private Long id;

	/** 容器ID，关联到其他表的记录 */
	private Long containerId;

	/** 容器类型，如Issue、Document等 */
	private String containerType;

	/** 原始文件名 */
	private String filename;

	/** 存储在磁盘上的文件名 */
	private String diskFilename;

	/**
	 * 文件路径
	 */
	private String filePath;

	/** 文件大小（字节） */
	private Long filesize;

	private String fileSizeValue;

	/** 文件MIME类型 */
	private String contentType;

	/** 文件哈希值 */
	private String digest;

	/** 下载次数 */
	private Long downloads;

	/** 上传者ID */
	private Long authorId;

	/** 删除标志（0代表存在 2代表删除） */
	@FieldMeta(name = "del_flag", description = "删除标志（0代表存在 2代表删除）")
	private Long delFlag;

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setContainerId(Long containerId) {
		this.containerId = containerId;
	}

	public Long getContainerId() {
		return containerId;
	}

	public void setContainerType(String containerType) {
		this.containerType = containerType;
	}

	public String getContainerType() {
		return containerType;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String getFilename() {
		return filename;
	}

	public void setDiskFilename(String diskFilename) {
		this.diskFilename = diskFilename;
	}

	public String getDiskFilename() {
		return diskFilename;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public void setFilesize(Long filesize) {
		this.filesize = filesize;
	}

	public Long getFilesize() {
		return filesize;
	}

	public String getFileSizeValue() {
		return fileSizeValue;
	}

	public void setFileSizeValue(String fileSizeValue) {
		this.fileSizeValue = fileSizeValue;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	public String getContentType() {
		return contentType;
	}

	public void setDigest(String digest) {
		this.digest = digest;
	}

	public String getDigest() {
		return digest;
	}

	public void setDownloads(Long downloads) {
		this.downloads = downloads;
	}

	public Long getDownloads() {
		return downloads;
	}

	public void setAuthorId(Long authorId) {
		this.authorId = authorId;
	}

	public Long getAuthorId() {
		return authorId;
	}

	public Long getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Long delFlag) {
		this.delFlag = delFlag;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
				.append("containerId", getContainerId()).append("containerType", getContainerType())
				.append("filename", getFilename()).append("diskFilename", getDiskFilename())
				.append("filesize", getFilesize()).append("contentType", getContentType()).append("digest", getDigest())
				.append("downloads", getDownloads()).append("authorId", getAuthorId()).append("delFlag", getDelFlag())
				.append("createBy", getCreateBy()).append("createTime", getCreateTime())
				.append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).toString();
	}
}
